package com.thread.CountDownLatchDemo;

import java.util.concurrent.CountDownLatch;

/**
 * @Author milian
 * @Date 2021/7/31 0031 9:36
 */
public class son1 extends Thread{
    private CountDownLatch downLatch;

    public son1(CountDownLatch downLatch) {
        this.downLatch = downLatch;
    }

    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            System.out.println(getName() + "在吃第" + i + "个饺子");
        }
        downLatch.countDown();
    }
}
